BEA Logo BEA WebLogic Server Release 1.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

   EJB 2.0 for BEA WebLogic Server:   Previous topic   |   Next topic   |   Contents   

 

Installing EJB 2.0 for BEA WebLogic Server

 

Overview

Requirements

Installing the EJB 2.0 Container

Configuring and Starting WebLogic Server

Using weblogic.ejbc20

Installing the EJB 2.0 Examples

Overview

The EJB 2.0 for BEA WebLogic Server distribution consists of a .zip file containing three separate .jar files. The .jar files contain supporting classes for the EJB 2.0 specification:

You install the Beta container by unzipping the .zip file and adding the resultant .jars to an existing WebLogic Server installation. After adding the files to your installation, you can optionally configure container properties in the weblogic.properties file before rebooting your server.

The modified WebLogic Server supports both EJB 1.1 beans, as described in the WebLogic Server Version 5.1 documentation, and EJBs based on the 2.0 specification, as described in this document.

Requirements

EJB 2.0 for BEA WebLogic Server requires:

Before following the installation instructions below, install the full WebLogic Server Version 5.1 product and Service Pack 3. You cannot use the EJB 2.0 container with any Version 5.1 Service Pack other than Service Pack 3. Service Pack 3 is available as a separate download from commerce.bea.com.

You must use the Java virtual machine in JDK version 1.2 or 1.3 to run WebLogic Server; the Beta EJB 2.0 container does not run under JDK versions 1.1.x.

Although the EJB 2.0 container installation does not modify or replace any installed WebLogic Server classes, BEA recommends that you apply and use the installation .jar with an evaluation or development installation of WebLogic Server Version 5.1 with Service Pack 3.

Installing the EJB 2.0 Container

To install EJB 2.0 for BEA WebLogic Server:

  1. Download the weblogic510ejb20b1.zip file.

  2. Unzip the contents of weblogic510ejb20b1.zip to a temporary directory. You should have the following installation files:

  3. Create a persistence20 directory in the lib subdirectory of your existing WebLogic Server Version 5.1 installation:

      $ mkdir %WL_HOME%\lib\persistence20

  4. Copy the ejb20-cmp.jar file to the /lib/persistence20 subdirectory.

      $ cp ejb20-cmp.jar %WL_HOME%\lib\persistence20

  5. Add the path to ejb20.jar to the beginning of the weblogic.class.path variable. For example, if you use startWebLogic.cmd to start the server, edit the following line:

    set WEBLOGIC_CLASSPATH=path\ejb20.jar;.\lib\persistence\weblogic510sp3.jar;.\license;.\classes;.\lib\weblogicaux.jar;.\myserver\serverclasses

    If you start WebLogic Server directly from a command line, add ejb20.jar directly to weblogic.class.path:

    c:\jdk122\bin\java -ms64m -mx64m -classpath .\classes\boot;.\eval\cloudscape\lib\cloudscape.jar -Dweblogic.class.path=path\ejb20.jar;.\lib\persistence\weblogic510sp3.jar;.\license;.\classes;.\lib\weblogicaux.jar;.\myserver\serverclasses -Dweblogic.home=. -Djava.security.manager -Djava.security.policy=.\weblogic.policy weblogic.Server

    Note: ejb20.jar must appear at the beginning of weblogic.class.path, before the Service Pack 3 .jar and any other .jar or class files.

  6. Complete the installation by following the instructions in Configuring and Starting WebLogic Server.

Configuring and Starting WebLogic Server

Installing the .jar files adds new EJB 2.0-specific supporting classes to your WebLogic Server installation. To enable the new container, you edit the weblogic.properties file to initialize the EJB 2.0 container startup class. You can also modify the behavior of the new startup class by setting startup arguments in weblogic.properties.

To configure EJB 2.0 for BEA WebLogic Server:

  1. Open the weblogic.properties file in a text editor.

  2. Add the following property line to the file:

    weblogic.system.startupClass.ejb20=weblogic.ejb20.deployer.DeployTrigger

    This line loads the startup class that creates the EJB 2.0 container.

  3. (Optional.) To change the deployment and redeployment behavior of the new container, you can optionally define startup arguments for the weblogic.ejb20.deployer.DeployTrigger startup class. Valid startup arguments are as follows:

    Argument

    Possible Values

    Description

    compiler

    compiler_name

    Specifies the Java compiler that WebLogic Server uses to automatically compile .jar files and .jar directories before deployment.

    deployment.checkSeconds

    0 - max_seconds

    Specifies how frequently WebLogic Server checks deployments in $WL_HOME/ejb_deployments to determine if redeployment is necessary.

    deployment.noEJBC

    true | false

    Determines whether or not WebLogic Server automatically runs ejbc20 to generate container classes for .jars and .jar directories in $WL_HOME/ejb_deployments.

    noCompile

    true | false

    Determines whether or not WebLogic Server automatically compiles .java files in .jars and .jar directories in $WL_HOME/ejb_deployments.

    For example, the following line instructs WebLogic Server to check the ejb_deployments directory every minute for changed .jar files or .jar directory deployments. If a deployment has changed, WebLogic Server compiles any .java files in the deployment using the jikes compiler, and runs weblogic.ejbc20 to generate container classes:

      weblogic.system.startupArgs.ejb20=deployment.noCompile=false,\

      deployment.noEJBC=false,compiler=jikes,deployment.checkSeconds=60

    See Deploying EJBs in the EJB 2.0 Container for more information about the new WebLogic Server deployment features.

  4. Start WebLogic Server. Details of the EJB 2.0 container configuration appear in the startup messages, as in the following sample output:

    Fri Jun 09 11:22:18 PDT 2000:<I> <WebLogicServer> Invoking T3StartupDef ejb20 we

    blogic.ejb20.deployer.DeployTrigger with {}

    EJB 2.0 Container Started..................................................[Yes]

    EJB Deployment Directory.......................................[ejb_deployments]

    EJB Temporary Directory.......................[tmp_deployments172.17.10.55_7001]

    EJB Deployment Java Compiler.............................................[javac]

    EJB EJBCompiler keepgenerated.............................................[true]

    EJB Deployment Check Interval (Seconds).....................................[10]

    EJB Server Java Compilation Enabled......................................[false]

    EJB Server EJB Compilation Enabled........................................[true]

    Mon Jun 05 11:22:18 PDT 2000:<I> <WebLogicServer> T3StartupDef ejb20 weblogic.ej

    b20.deployer.DeployTrigger reports:EJB-20 Deploy Trigger

Using weblogic.ejbc20

The ejbc20.jar file also contains supporting classes for the weblogic.ejbc20 compiler, which is required for generating WebLogic Server EJB 2.0 container classes. To use weblogic.ejbc20, you must place the ejbc20.jar file at the beginning of the Java classpath for your development environment. For example:

$ set CLASSPATH=path/ejbc20.jar;%CLASSPATH%

$ java weblogic.ejbc20 -help

Note: Place ejbc20.jar only in the Java classpath for your development environment. Do not place ejbc20.jar in the Java classpath that you use to start WebLogic Server.

Installing the EJB 2.0 Examples

To install the WebLogic Server EJB 2.0 examples, extract the ejb20-examples.zip file to the examples subdirectory of your existing WebLogic Server Version 5.1 installation:

$ cd %WL_HOME%

$ jar xvf path\ejb20-examples.zip

This creates an ejb20 subdirectory that contains the following examples.

Build each example using the provided build script or make file. See Deploying EJBs in the EJB 2.0 Container for new deployment instructions.